package com.proposition.support.controller;

import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;

/**
 * ${DESCRIPTION}
 *
 * @author 杨凯
 * @create 2017-10-31 10:45
 **/
@Controller
public class ErrorController {

	@RequestMapping(value = "/404", method = RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.NOT_FOUND)
	public String fileNotFound() {
		return "404";
	}

	@RequestMapping(value = "/403", method = RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.FORBIDDEN)
	public String forbidden() {
		return "403";
	}

	@RequestMapping(value = "/500", method = RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
	public String internetError() {
		return "500";
	}

	@RequestMapping(value = "/401", method = RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.NON_AUTHORITATIVE_INFORMATION)
	public String unauthorized() {
		return "401";
	}
}
